#!/bin/bash

printhelp()
{
	echo "Usage: cptopi [option]  localfile remote_folder"
	echo "or     cptopi -d [option]  remotefile local_folder"
	echo "option:"
	echo "     -r  copy directory, if not use -r,is copying files."
}

if [ "$1" == "-d"  ]
then 
	if [ $2 == '-r' ] && [ $# == 4 ]
	then
		scp -r pi@chendilin.f3322.net:$3 $4
	elif [ $# == 3 ]
	then
		scp pi@chendilin.f3322.net:$2 $3
	else
		printhelp
	fi
elif [ "$1" == '-r' ]
then 
	scp -r $2 pi@chendilin.f3322.net:$3
elif [ $# == 2 ]
then
	scp $1 pi@chendilin.f3322.net:$2
else
	printhelp
fi
	

